home *** CD-ROM | disk | FTP | other *** search
/ Dr. Windows 3 / dr win3.zip / dr win3 / DATABASE / SECURE.ZIP / SECUR11.TXT < prev   
Text File  |  1993-09-30  |  33KB  |  618 lines

  1. Microsoft Access Security
  2. Last Updated:  09/15/93
  3.  
  4. Purpose
  5. The purpose of this document is to explain the Microsoft Access security 
  6. model.  The hope is that if the user understands the intricacies of 
  7. security, and is conscientious, he will be able to safely and 
  8. successfully use Microsoft Access security in his databases.
  9.  
  10. Examples of scenarios that have caused difficulty for people in the past 
  11. have been set apart under the heading of Gotcha.  These are intended to 
  12. give practical examples of common misunderstandings, and to explain why 
  13. Microsoft Access security works the way it does.
  14.  
  15. This document is applicable to Microsoft Access versions 1.0 and 1.1, as 
  16. well as to the Microsoft Access Distribution Kit (ADK).  Features new to 
  17. Microsoft Access 1.1 and the ADK are called out with New for 1.1.
  18.  
  19. Disclaimer:  There are several places in this document where the 
  20. Microsoft Access sytem tables (those MSys*) are referred to.  In spite 
  21. of this, these tables are officially "undocumented", and are subject to 
  22. change in future versions.  Any attempts to read from or especially to 
  23. write to these tables will most almost certainly fail future versions of 
  24. Microsoft Access.
  25. Overview
  26. Microsoft Access security consists of 2 parts which are stored in 
  27. different places.  Information regarding the permissions that users and 
  28. groups have on the objects in a database is stored in the database 
  29. itself.  This way the permission information travels with the .mdb file 
  30. in which the objects exist.  All other security information is stored in 
  31. the SystemDB specified in msaccess.ini.  The default SystemDB is 
  32. system.mda.  Information stored in the SystemDB includes:  which Users & 
  33. Groups exist;  which Groups each User belongs to;  and User logon 
  34. passwords.  In Microsoft Access parlance, a SystemDB defines a 
  35. "Workgroup".
  36.  
  37. Note:  Retail Microsoft Access looks for the file msaccess.ini to find 
  38. it's settings, including SystemDB.  Applications created with the ADK 
  39. can specify any file for these settings (e.g. myapp.ini.)  For the 
  40. purposes of this document, msaccess.ini and myapp.ini are 
  41. interchangeable.
  42. Logging On
  43. Each User and Group has associated with it a Security ID (SID).  The SID 
  44. is a binary string that uniquely identifies the User or Group.  When a 
  45. user logs on, Microsoft Access looks in the MSysAccounts table of the 
  46. SystemDB for a user of the same name (case-insensitive).  If a user with 
  47. the same name is found, it then validates the password (case-sensitive).  
  48. If the password matches, the SID of the user is retrieved and saved in 
  49. an internal structure.  The password is only used to validate the user 
  50. when he logs on.  Other than validating the identity of the user when he 
  51. logs on, it has no effect on security.
  52.  
  53. By default, Microsoft Access first attempts to logon as the user Admin, 
  54. with a blank password.  If this logon fails, the user is presented with 
  55. the Logon dialog.  If a user name and password were specified on the 
  56. command line (using the /USER and /PWD flags), Microsoft Access first 
  57. tries to logon using that user name and password.  If this logon fails, 
  58. the user is presented with the Logon dialog.  Once logged on, the user's 
  59. SID is retrieved.  This SID is used for all subsequent security 
  60. operations within Microsoft Access.
  61. Users and Groups
  62. Each user can be a member of 1 or more groups.  Users & Groups share the 
  63. same namespace.  This means that you can't have both a group and user 
  64. with the same name.
  65.  
  66. Microsoft Access defines 3 default groups:  Admins, Users, and Guests.  
  67. Whenever a user is added to the SystemDB, they are automatically given 
  68. membership in the group Users, and they cannot be removed from the Users 
  69. group.  There is one exception to this rule---the user Guest CAN be 
  70. removed from the Users group.  The Admins group must always have at 
  71. least one member.
  72.  
  73. Microsoft Access defines 2 users:  Admin and Guest.  The user Admin is a 
  74. member of the Admins and Users groups.  The user Guest is a member of 
  75. the Guests group (only).
  76.  
  77. The pre-defined groups (Admins, Users, and Guests) cannot be deleted.  
  78. The user Guest cannot be deleted, though the user Admin CAN if there is 
  79. at least one other member of the Admins group.  Chapter 25 of the Access 
  80. Users Guide recommends deleting the Admin account.  The only reason for 
  81. this recommendation is so that you don't accidentally create any objects 
  82. using this account.  Objects created by Admin cannot be secured.
  83.  
  84. Each user and group has a SID associated with it.  The SIDs of the Users 
  85. and Guests groups, and of the Admin and Guest users, are the same in all 
  86. Microsoft Access installations.  The SID of the Admins group, however, 
  87. is unique across all Microsoft Access installations.  This prevents 
  88. someone who is in the Admins group of one SystemDB from being able to 
  89. have the permissions of the Admins group of any other SystemDB.
  90.  
  91. Gotcha:  If you delete the user Admin, and then create 
  92. another user named Admin, the SID of the new Admin will NOT 
  93. be the same as the SID of the Admin that exists in an 
  94. unsecure system.  This is because the Admin user that you 
  95. create will have a different PIN that the Admin user that 
  96. exists in a freshly-installed SystemDB.
  97.  
  98. If you setup from the Microsoft Access disks, the SID of the Admins 
  99. group is a function of the serial number of the Setup disk and the User 
  100. and Company names given (case-insensitive).  Therefore, it is critical 
  101. that the disks used to install Microsoft Access be kept in a safe place, 
  102. and that the User and Company names be recorded.  
  103.  
  104. New for 1.1:  You can also create a SystemDB by running the Change 
  105. Workgroup utility.  Using Change Workgroup, you are able specify a 
  106. Personal Identification Number (PIN) in place of the disk serial number, 
  107. as well as any User and Company names.  This PIN can be any alphanumeric 
  108. string, up to 20 characters long.  The the SID of the Admins group will 
  109. be determined by these values (also case-insensitive).
  110.  
  111. In the event that the SystemDB has to be recreated, you must either have 
  112. the same installation disks, or have recorded the PIN, User name, and 
  113. Company name used to create it.  Because the Change Workgroup 
  114. functionality removes the connection between the original disks and 
  115. Access security, this is the recommended method of creating a SystemDB.
  116.  
  117. The SIDs of users and groups that you create are a function of the user 
  118. or group name (case-sensitive) and Personal Identification Number (PIN) 
  119. that you specify.  For this reason it is critical that the user and 
  120. group names and their PINs be recorded.  If there is ever a need to 
  121. recreate the SystemDB, you will need the name and PIN of each user and 
  122. group that was in the SystemDB.  Note that by using different PINs, it 
  123. possible for users and groups in different SystemDB's to have the same 
  124. name, but they will actually be different accounts as far as Microsoft 
  125. Access security is concerned because they have different SIDs.
  126.  
  127. Gotcha:  When you setup Microsoft Access, the User and 
  128. Company names are written to Disk #1.  If you then give 
  129. anyone else your disks to setup from, Microsoft Access 
  130. doesn't prompt for the User and Company name.  The Admins 
  131. group in the SystemDB that is created will have the same SID 
  132. as the Admins group in your SystemDB.  This means that 
  133. anyone who uses that new SystemDB will have all the 
  134. permissions that you do, in any databases that you have 
  135. permissions.  While this functionality wasn't intended as a 
  136. form of copy protection, it is a good incentive to abide by 
  137. the License Agreement.  It is also a good reason to create 
  138. your SystemDB using the Change Workgroup utility in 
  139. Microsoft Access 1.1
  140. Permissions
  141. There are 2 types of permissions:  Explicit and Implicit.  Explicit 
  142. permissions are those given directly to a user.  When they are granted, 
  143. no other users are affected.  Implicit permissions are those granted to 
  144. a group.  When they are granted, all users who are members of the group 
  145. get the permissions of the group.  Implicit permissions belong to the 
  146. group, not the